insert overwrite table jms_dm.dm_lmdm_three_segment_map_hi partition (dt)
select
     t.is_refund
    ,t.pick_network_code
    ,t.pick_network_name
    ,t.sign_finance_code
    ,t.sign_finance_name
    ,t.sign_network_code
    ,t.sign_network_name
    ,t.sign_time
    ,t.waybill_no
    ,t.sj_first_code
    ,t.sj_second_code
    ,t.sj_third_code
    ,t.dispatch_staff_code
    ,t.dispatch_staff_name
    ,t.receiver_province_id
    ,t.receiver_province_name
    ,t.receiver_city_id
    ,t.receiver_city_name
    ,t.receiver_area_id
    ,t.receiver_area_name
    ,t.receiver_township
    ,t.receiver_street
    ,t.receiver_detailed_address
    ,t.date_time
    ,'{{ execution_date | cst_hour }}' as dt
from   jms_dm.dm_lmdm_three_segment_map_dt t
join jms_dim.dim_yl_lmdm_sys_map_splitting_hi map1 on t.sign_network_code=map1.network_code
where t.dt >= date_add('{{ execution_date  | cst_ds }}', -3)
and map1.status in('0','1','2','3')   and   map1.is_delete='1'
 distribute by pmod(hash(rand()), 10)
;
